package br.com.ac.fatureweb.model.carga;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import br.com.ac.fatureweb.integration.model.SaldoDebitoCreditoVO.EnumTypeSaldo;
import br.com.ac.fatureweb.model.Carga;
import br.com.ac.fatureweb.utilitary.Model;

@Entity
@Table(name = "SAL_DEBITO_CREDITO")
@SequenceGenerator(name = "SEQ_DEBITO_CREDITO", sequenceName = "SEQ_DEBITO_CREDITO", allocationSize = 1, initialValue = 1)
public class SaldoDebitoCredito extends Model {

	/**
	 * 
	 */
	private static final long serialVersionUID = -8531097515044629402L;

	@Id
	@GeneratedValue(generator = "SEQ_DEBITO_CREDITO", strategy = GenerationType.SEQUENCE)
	@Column(name = "ID")
	private Long id;

	@Column(name = "INSCRICAO")
	private Long inscricao;

	@Column(name = "TIPO")
	@Enumerated(EnumType.ORDINAL)
	private EnumTypeSaldo tipo;

	@Column(name = "CONSUMO")
	private Long consumo;

	@ManyToOne
	@JoinColumn(name = "ID_CARGA", referencedColumnName = "ID")
	private Carga carga;

	public SaldoDebitoCredito() {
		super();
	}

	public SaldoDebitoCredito(Long id, Long inscricao, EnumTypeSaldo tipo,
			Long consumo, Carga carga) {
		super();
		this.id = id;
		this.inscricao = inscricao;
		this.tipo = tipo;
		this.consumo = consumo;
		this.carga = carga;
	}

	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @return the inscricao
	 */
	public Long getInscricao() {
		return inscricao;
	}

	/**
	 * @param inscricao
	 *            the inscricao to set
	 */
	public void setInscricao(Long inscricao) {
		this.inscricao = inscricao;
	}

	/**
	 * @return the tipo
	 */
	public EnumTypeSaldo getTipo() {
		return tipo;
	}

	/**
	 * @param tipo
	 *            the tipo to set
	 */
	public void setTipo(EnumTypeSaldo tipo) {
		this.tipo = tipo;
	}

	/**
	 * @return the consumo
	 */
	public Long getConsumo() {
		return consumo;
	}

	/**
	 * @param consumo
	 *            the consumo to set
	 */
	public void setConsumo(Long consumo) {
		this.consumo = consumo;
	}

	/**
	 * @return the carga
	 */
	public Carga getCarga() {
		return carga;
	}

	/**
	 * @param carga
	 *            the carga to set
	 */
	public void setCarga(Carga carga) {
		this.carga = carga;
	}

}
